All Functions Used So Far, Week 3

library

{base}

Load an R package

length

{base}

Returns number of elements in an object

median

{stats}

Get median of a vector

setwd

{base}

Set Working Directory

mean

{base}

Get mean of a vector

modelsummary

{modelsummary}

Creates regression and data tables

max

{base}

Get maximum of a vector

head

{utils}

Show first 5 rows of a data frame

pnorm

{base}

Returns the cumulative distribution function (CDF) of the normal distribution

ungroup

{dplyr}

Resolve grouping created with “group_by”

as.character

{base}

Coerce a vector to character

group_tt

{tinytable}

Grouping in tinytable

arrange

{dplyr}

Sort values of data frame according to a variable/combination of variables

data.frame

{base}

Create a data.frame from vectors

is.na

{base}

Check if a value is NA/elements of vector are NA

dnorm

{stats}

Density distribution for the normal distribution

rnorm

{base}

Generate random numbers from a normal distribution

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

filter

{dplyr}

Filter out rows of a data frame according to logical vector

sample

{base}

Takes a sample of the specified size

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

range

{base}

Return range of values

expression

{base}

Used in plots to add symbols to axes

glm

{base}

Fits generalized linear models

seq

{base}

Create a sequence

mutate

{dplyr}

Create new variables

nrow

{base}

Get number of rows of a data frame

c

{base}

Combine values/vectors into a vector

str

{utils}

Get the structure of an R object

par

{graphics}

Set parameters of the plotting device

which

{base}

return indexes of TRUE entries of a logical vector

order

{base}

Get indexes that will sort a vector

sd

{stats}

Get standard deviation of a vector

list

{base}

Create a list object

var

{stats}

Calculate variance

lm

{stats}

Fit linear models using least squares

log

{base}

log (default base = e)

tibble

{tibble}

A modern data frame from the tidyverse

min

{base}

Get minimum of a vector

plot

{graphics}

Generic function from base R to produce a plot

nobs

{stats}

Return the number of observations in a model object

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

predict

{stats}

Generate predicted values from model objects

ifelse

{base}

Return a or b depending on the value of test

binomial

{base}

Family argument in glm()

cut

{base}

Convert Numeric to Factor

summary

{base}

Obtain summary statistics or detailed regression output

ordered

{dplyr}

Create an ordered factor

names

{base}

Get or set names of an object

read_excel

{readxl}

Read an Excel file

The end!